package mutsumimod.cards.custom;

import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.DexterityPower;
import com.megacrit.cardcrawl.powers.StrengthPower;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.powers.StandPower;
import mutsumimod.util.CardStats;

public class HumanSmell extends BaseCard {
    public static final String ID = makeID(HumanSmell.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.SKILL,
            CardRarity.UNCOMMON,
            CardTarget.SELF,
            1
    );

    public HumanSmell() {
        super(ID, info);
        setAttr(0,0,2);
        setAttrUpg(0,0,1);
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        int amount = 0;
        if(p.hasPower(StandPower.POWER_ID)){
            amount = p.getPower(StandPower.POWER_ID).amount;
        }
        if(amount > 0){
            amount=Math.min(magicNumber,amount);
            reducePower(StandPower.POWER_ID,amount);
            applyPowerSelf(new StrengthPower(p, amount),amount);
            applyPowerSelf(new DexterityPower(p, amount),amount);
        }
    }

    @Override
    public AbstractCard makeCopy() { //Optional
        return new HumanSmell();
    }

}
